<template>
  <div>
    <h1>Footer--{{ price }}</h1>
    <button @click="decrement({n:10})">累减</button>
    <h2>电影列表<button @click="getMovieList">获取</button></h2>
    <ul>
      <li v-for='item in movieList' :key='item.tvId'>{{item.albumName}}</li>
    </ul>
  </div>
</template>

<script>
import { mapMutations } from 'vuex';
export default {
  name: "Footer",

  computed: {
    price() {
      return this.$store.state.price;
    },
    movieList(){
      return this.$store.state.movieList
    }
  },
  methods: {
    // decrement(n) {
    //   this.$store.commit('decrement',{n})
    // },
    // ...mapMutations(['decrement'])
    ...mapMutations({decrement:'decrement'}),

    getMovieList(){
      this.$store.dispatch('getMovieList')
    }
    
  },
};
</script>

<style>
</style>